// 题目链接：https://www.luogu.com.cn/problem/P1747

#include <iostream>
#include <algorithm>
#include <cstring>
#include <iomanip>
#include <queue>

#define x first
#define y second

using namespace std;

typedef pair<int, int> PII;

const int N = 50;

int dist[N][N];
int x1, y1, x2, y2;
queue<PII> q;

int dx[] = {-1, -2, -2, -1, 1, 2, 2, 1, 2, 2, -2, -2};
int dy[] = {2, 1, -1, -2, -2, -1, 1, 2, 2, -2, 2, -2};

void BFS(int x0, int y0)
{
    memset(dist, -1, sizeof dist);
    q.push({x0, y0});
    dist[x0][y0] = 0;

    while (!q.empty())
    {
        auto t = q.front();
        q.pop();

        for (int i = 0; i < 12; ++i)
        {
            int next_x = t.x + dx[i];
            int next_y = t.y + dy[i];

            if (next_x <= 0 || next_x > N || next_y <= 0 || next_y > N)
                continue;
            if (dist[next_x][next_y] >= 0)
                continue;

            q.push({next_x, next_y});
            dist[next_x][next_y] = dist[t.x][t.y] + 1;

            if (dist[x1][y1] >= 0 && dist[x2][y2] >= 0)
                return;
        }
    }
}

int main()
{
    cin >> x1 >> y1 >> x2 >> y2;

    BFS(1, 1);

    printf("%d\n", dist[x1][y1]);
    printf("%d\n", dist[x2][y2]);

    return 0;
}